#pragma warning disable 0618
using System;
using System.Collections.Generic;
using Table.DataModel;
namespace Table.Dao
{
    public class TableUSFSkillDao:DaoBase<TableUSFSkill>
    {
        public override string GetFileName()
        {
            return "TableUSFSkill.csv";
        }
        public override void BuildIndex()
        {
            if (cacheList != null)
            {
                cachePrimaryInt = new Dictionary<int, TableUSFSkill>(cacheList.Count);
            }
            base.BuildIndex();
        }
        public override void AddPrimaryIndex(TableUSFSkill model)
        {
            #if UNITY_EDITOR
            if(cachePrimaryInt.ContainsKey(model.skillId)) UnityEngine.Debug.LogError("数据表id重复:TableUSFSkill->id: " + model.skillId);
            #endif
            cachePrimaryInt[model.skillId] = model;
        }
        protected override TableUSFSkill ParseRowData(string[] rowData)
        {
            TableUSFSkill data = new TableUSFSkill();
            if (!string.IsNullOrEmpty(rowData[0]))
            {
                data.skillId = int.Parse(rowData[0]);
            }
            if (!string.IsNullOrEmpty(rowData[1]))
            {
                data.skillType = int.Parse(rowData[1]);
            }
            if (!string.IsNullOrEmpty(rowData[2]))
            {
                data.triggerType = int.Parse(rowData[2]);
            }
            if (!string.IsNullOrEmpty(rowData[3]))
            {
                data.unloadType = int.Parse(rowData[3]);
            }
            if (!string.IsNullOrEmpty(rowData[4]))
            {
                data.activeTime = int.Parse(rowData[4]);
            }
            if (!string.IsNullOrEmpty(rowData[5]))
            {
                data.closeType = int.Parse(rowData[5]);
            }
            if (!string.IsNullOrEmpty(rowData[6]))
            {
                data.triggerCondition = rowData[6];
            }
            if (!string.IsNullOrEmpty(rowData[7]))
            {
                data.duration = int.Parse(rowData[7]);
            }
            if (!string.IsNullOrEmpty(rowData[8]))
            {
                data.selectType = int.Parse(rowData[8]);
            }
            if (!string.IsNullOrEmpty(rowData[9]))
            {
                data.selectCondition = rowData[9];
            }
            if (!string.IsNullOrEmpty(rowData[10]))
            {
                data.usfBuffers = rowData[10];
            }
            if (!string.IsNullOrEmpty(rowData[11]))
            {
                data.stateParticle = rowData[11];
            }
            if (!string.IsNullOrEmpty(rowData[12]))
            {
                data.icon = rowData[12];
            }
            if (!string.IsNullOrEmpty(rowData[13]))
            {
                data.desc = rowData[13];
            }
            return data;
        }
    }
}
